package com.ruoyi.job.fallbackFactory.impl;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.job.fallbackFactory.RemoteSystemAppService;
import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 用户服务降级处理
 * 
 * @author ruoyi
 */
@Component
public class RemoteSystemAppFallbackFactory implements FallbackFactory<RemoteSystemAppService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteSystemAppFallbackFactory.class);

    @Override
    public RemoteSystemAppService create(Throwable throwable)
    {
        log.error("app服务调用失败:{}", throwable.getMessage());
        return new RemoteSystemAppService()
        {

            @Override
            public void timingLottery(String source) {
                log.error("app服务调用失败:定时自动开奖（未开红包），未开奖的用户自动开奖(凌晨之前)");
            }

            @Override
            public void startGroup(Long groupId, String source) {
                log.error("app服务调用失败:开始开团");
            }

            @Override
            public void freedOrderRewards(String source) {
                log.error("app服务调用失败:释放拼团基金奖励（订购奖励）（24小时后释放）");
            }

            @Override
            public void grossOutputMain(String source) {
                log.error("app服务调用失败:总产值释放到ftc小、pc入口");
            }

            @Override
            public void beforeDawnInit(String source) {
                log.error("app服务调用失败:凌晨0点初始化操作");
            }

            @Override
            public void automaticListingExecute(String source) {
                log.error("app服务调用失败:自动挂卖ftc大(开启ftc自动挂卖，开启任务定时)");
            }

            @Override
            public void automaticRecycling(String source) {
                log.error("app服务调用失败:ftc自动回收");
            }

            @Override
            public void fullAccountInit(String source) {
                log.error("app服务调用失败:计算满额账户");
            }

            @Override
            public void teamExamineInit(String source) {
                log.error("app服务调用失败:计算团队考核");
            }

            @Override
            public void teamRewardSettlementInit(String source) {
                log.error("app服务调用失败:团队奖励结算收益");
            }
        };
    }
}
